part of '../repository.dart';

class _SubscriptionCancellationSurveyResultDto extends Equatable {
  const _SubscriptionCancellationSurveyResultDto._internal({
    required this.reasonCode,
    required this.customAnswer,
  });

  final int reasonCode;
  final String? customAnswer;

  @override
  List<Object?> get props {
    return [
      reasonCode,
      customAnswer,
    ];
  }

  // factory _SubscriptionCancellationSurveyResultDto.fromJson(Map<String, dynamic> json) {
  //   return _SubscriptionCancellationSurveyResultDto._internal(
  //     reasonCode: json['cancelSurveyReason'],
  //     customAnswer: json['userInputCancelReason'],
  //   );
  // }

  factory _SubscriptionCancellationSurveyResultDto.fromApiSubscriptionCancelSurveyResult(
      SubscriptionCancelSurveyResult apiSubscriptionCancelSurveyResult) {
    return _SubscriptionCancellationSurveyResultDto._internal(
      reasonCode: apiSubscriptionCancelSurveyResult.cancelSurveyReason!,
      customAnswer: apiSubscriptionCancelSurveyResult.userInputCancelReason,
    );
  }
}
